<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>Home</title>
    <link href="/css/bootstrap.css" rel='stylesheet' type='text/css' />
    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <!-- Custom Theme files -->
    <link href="/css/style.css" rel='stylesheet' type='text/css' />
    <!-- Custom Theme files -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="keywords" content="Hotel Deluxe Responsive web template, Bootstrap Web Templates, Flat Web Templates, Android Compatible web template,
Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, SonyEricsson, Motorola web design" />
    <script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
    <!--webfont-->
    <link href='https://fonts.googleapis.com/css?family=Montserrat:400,700' rel='stylesheet' type='text/css'>
    <script type="text/javascript" src="/js/jquery-1.11.1.min.js"></script>
    <script type="text/javascript" src="/js/login.js"></script>
    <script src="/js/jquery.easydropdown.js"></script>
    <script src="/js/jquery-1.11.1.min.js"></script>
    <!--Animation-->
    <script src="/js/wow.min.js"></script>
    <link href="/css/animate.css" rel='stylesheet' type='text/css' />
    <script>
        //	new WOW().init();
    </script>
</head>
<body>

<div class="header">
    <div class="col-sm-8 header-left">
        <div class="logo">
            <a href="/"><img src="/images/logos.png" alt=""/></a>
        </div>
        <div class="menu">
            <a class="toggleMenu" href="#"><img src="/images/nav.png" alt="" /></a>
            <ul class="nav" id="nav">
                <li class="active"><a href="#">个人中心</a></li>

                <li><a th:if="${session.user==null}" href="#">我的订单</a></li>
                <li><a th:if="${session.user}" th:href=" '/order/list?userId=' + ${session.user.userId}">我的订单</a></li>
                <div class="clearfix"></div>
            </ul>
            <script type="text/javascript" src="js/responsive-nav.js"></script>
        </div>
        <!-- start search-->
        <!----search-scripts---->
        <script src="/js/classie.js"></script>
        <script src="/js/uisearch.js"></script>
        <script>
            //
        </script>
        <!----//search-scripts---->
        <div class="clearfix"></div>
    </div>
    <div class="col-sm-4 header_right">
        <div id="loginContainer"><a href="#" id="loginButton"><img src="/images/login.png">
            <span th:if="${session.user==null}">登陆</span>
            <a href="/info"><span th:if="${session.user}" th:text="${session.user.displayName}"></span></a>
            <input type="button" id="logout" value="注销" onclick="userlogout()"  th:if="${session.user}">
        </a>
            <div id="loginBox">
                <form id="loginForm" action="/user/login" method="post">
                    <fieldset id="body">
                        <fieldset>
                            <label>用户名</label>
                            <input type="text" name="username" id="username">
                        </fieldset>
                        <fieldset>
                            <label>密码</label>
                            <input type="password" name="password" id="password">
                        </fieldset>
                        <fieldset th:if="${loginFailure}">
                            <label style="color: red">用户名或密码错误</label>
                        </fieldset>
                        <input type="submit" id="login" value="登陆">
                        <!--<label for="checkbox"><input type="checkbox" id="checkbox"> <i>Remember me</i></label>-->
                    </fieldset>
                    <span style="display: inline"><a th:href="@{/register.html}">注册新账户</a></span>
                    <span style="display: inline"><a th:href="@{/findpsw.html}">忘记密码</a></span>
                </form>
            </div>
        </div>
        <div class="clearfix"></div>
    </div>
    <div class="clearfix"></div>
</div>
<script th:inline="javascript">
    if ([[${loginFailure}]] == true) {
        $('#loginBox').toggle()
    }
</script>

</head>
<body>
<div class="content_middle">
    <div class="container_wrap">
        <h2 class="title block-title" style="padding-top: 2em;">我的订单</h2>
        <style>
            table,thead,th,td{
                color:darkslategray;
            }
        </style>
        <table border="2" width="95%" style="text-align: center;margin: auto" >
            <thead>
            <th>订单号</th>
            <th>房间号</th>
            <th>订单创建时间</th>
            <th>入住时间</th>
            <th>退房时间</th>
            <th>价格</th>
            <th>状态</th>
            <br>
            </thead>
            <tbody>
            <tr th:each="order: ${orders}">
                <td th:text="${order.getOrderId()}"></td>
                <td th:text="${order.getRoomId()}"></td>
                <td th:text="${#dates.format(order.getCreateTime(), 'yyyy-MM-dd')}"></td>
                <td th:text="${#dates.format(order.getCheckinTime(), 'yyyy-MM-dd')}"></td>
                <td th:text="${#dates.format(order.getCheckoutTime(), 'yyyy-MM-dd')}"></td>
                <td th:text="${order.getTotalprice()}"></td>
                <td th:if="${order.getStatus()}==2"><a th:href=" '/order/pay?orderId='+${order.orderId}">未支付</a> </td>
                <td th:if="${order.getStatus()}==1" th:text="已支付"></td>

            </tr>
            </tbody>
        </table>
        <div class="form-submit1">
            <a href="/"><input name="register"  type="button"  value="返回首页"></a>
        </div>
        <h2 class="title block-title" style="padding-top: 4em">MY ORDER END</h2>
        <h1>&nbsp;</h1><h1>&nbsp;</h1><h1>&nbsp;</h1><h1>&nbsp;</h1><h1>&nbsp;</h1><h1>&nbsp;</h1><h1>&nbsp;</h1><h1>&nbsp;</h1><h1>&nbsp;</h1>
    </div>
</div>
<div class="footer">
    <div class="container"></div>
    <div class="footer_top">
        <h3>&nbsp;</h3>
        <h3>四川大学酒店订购系统</h3>
        <h3>Team 22</h3>
    </div>
</div>
</body>
</html>